<?php
for($r = $offset; $r < ($offset+$limit); $r++)
{
	$data = $temp_array[$r];
	$content_array = $data['content'];

	//if its IE7 then force the content_type to be small 
	if($browser_array['version'] == "7.0" && $browser_array['short_name'] == "MSIE")
	{
		//force the content type to be worksmall for all work type items
		switch($data['content_type'])
		{
			case "workbigsocial":
			case "workbig":
			case "worksmallimg":
				$data['content_type'] = "worksmall";
			break;
			case "newsbig":
				$data['content_type'] = "newssmall";
			break;
		}
	}
	switch($data['content_type'])
	{
		case "workbigsocial":
			$url = "/work/campaign/".clean_url($content_array[0]['client_title'])."/".$content_array[0]['campaign_url_slug']."/".$content_array[0]['url_slug']."";
		?>
			<div class="item work super featured tile-item">
				<div class="pic">
					<a href="<?php echo $url?>"><img src="<?php echo ASSET_STORE_CAMPAIGNS_WORK_ABSOLUTE.$content_array[0]['image']?>" /></a>
				</div>
				<div class="info">
					<hgroup>
						<h3 class="light"><?php echo $content_array[0]['client_title']?></h3>
						<h3><?php echo $content_array[0]['title']?></h3>
					</hgroup>

					<?php 
					///check if any tweets
					$tweets_array = $content_array[0]['tweets'];
					$tweets_array_count = count($tweets_array);
					if($tweets_array_count > 0)
					{
					?>
					<div class="slideshow homepage-tile-slideshow work large">
						
						<div class="slide-holder" id="oWorkSlider<?php echo $i?>" data-interact="slideshow" data-interact-target="0" data-play="manual">

							<?php 
							foreach($tweets_array as $tweets)
							{
							?>
							<div class="slide">
								<div class="slide-content">
									<div class="social-tweet">
										<div class="tweet-body"><?php echo linkify($tweets['tweet'])?></div>
										<div class="tweet-handle">
											<?php echo $tweets['tweet_signoff']?><br/>
											<a href="http://www.twitter.com/<?php echo $tweets['tweet_username']?>" target="_blank">@<?php echo $tweets['tweet_username']?></a>
										</div>
									</div>
								</div>
							</div>
							<?php 
							}
							?>
						</div>
					</div>
					
					<div class="slide-handles right" data-special-class="small-bullet work" data-interact="slide-handles" data-linked="oWorkSlider<?php echo $i?>" data-handle="count"></div>
					<?php 
					}
					?>
				</div>
			</div>
		<?php
		break;
		case "workbig":
			$url = "/work/campaign/".clean_url($content_array[0]['client_title'])."/".$content_array[0]['campaign_url_slug']."/".$content_array[0]['url_slug']."";
		?>
			<div class="item work large featured tile-item">
				<div class="pic">
					<a href="<?php echo $url?>"><img src="<?php echo ASSET_STORE_CAMPAIGNS_WORK_ABSOLUTE.$content_array[0]['image']?>" /></a>
				</div>
				<div class="info">
					<?php echo $content_array[0]['client_title']?><br/>
					<strong><?php echo $content_array[0]['title']?></strong>
				</div>
			</div>
		<?php
		break;
		case "worksmall":
			$url = "/work/campaign/".clean_url($content_array[0]['client_title'])."/".$content_array[0]['campaign_url_slug']."/".$content_array[0]['url_slug']."";
			
			$image_info_array = pathinfo($content_array[0]['image']);
			$image_path = ASSET_STORE_CAMPAIGNS_WORK_ABSOLUTE.$image_info_array['filename']."-small.".$image_info_array['extension'];
		?>
			<div class="item work single featured tile-item">
				<div class="pic">
					<a href="<?php echo $url?>"><img src="<?php echo $image_path?>" /></a>
				</div>
				<div class="info">
					<?php echo $content_array[0]['client_title']?><br/>
					<strong><?php echo $content_array[0]['title']?></strong>
				</div>
			</div>
		<?php
		break;
		case "worksmallimg":
			$url = "/work/campaign/".clean_url($content_array[0]['client_title'])."/".$content_array[0]['campaign_url_slug']."/".$content_array[0]['url_slug']."";
			
			$image_info_array = pathinfo($content_array[0]['image']);
			$image_path = ASSET_STORE_CAMPAIGNS_WORK_ABSOLUTE.$image_info_array['filename']."-small.".$image_info_array['extension'];
		?>
			<div class="item work double-vert featured tile-item">
				<div class="pic">
					<a href="<?php echo $url?>"><img src="<?php echo $image_path?>" /></a>
				</div>
				<div class="info">
					<?php echo $content_array[0]['client_title']?><br/>
					<strong><?php echo $content_array[0]['title']?></strong>

					<?php 
					///check if any tweets
					$tweets_array = $content_array[0]['tweets'];
					$tweets_array_count = count($tweets_array);
					if($tweets_array_count > 0)
					{
					?>
					<div class="slideshow homepage-tile-slideshow work">
						<div class="slide-holder" id="oWorkSlider<?php echo $i?>" data-interact="slideshow" data-interact-target="0" data-play="manual">
							<?php 
							foreach($tweets_array as $tweets)
							{
							?>
							<div class="slide">
								<div class="slide-content">
									<div class="social-tweet">
										<div class="tweet-body"><?php echo linkify($tweets['tweet'])?></div>
										<div class="tweet-handle">
											<?php echo $tweets['tweet_signoff']?><br/>
											<a href="http://www.twitter.com/<?php echo $tweets['tweet_username']?>" target="_blank">@<?php echo $tweets['tweet_username']?></a>
										</div>
									</div>
								</div>
							</div>
							<?php 
							}
							?>
						</div>
					</div>
					
					<div class="slide-handles right" data-special-class="small-bullet work" data-interact="slide-handles" data-linked="oWorkSlider<?php echo $i?>" data-handle="count"></div>
					<?php 
					}
					?>
				</div>
			</div>
		<?php
		break;
		case "newssmall":
		?>
		<a href="/news/view/<?php echo $content_array[0]['url_slug']?>" class="tile-item">
			<div class="item news single featured tile-item">
				<strong><?php echo format_date($content_array[0]['date'], "d")?><span class="accent">/</span><?php echo format_date($content_array[0]['date'], "m")?><span class="accent">/</span><?php echo format_date($content_array[0]['date'], "y")?></strong>
				<h3><?php echo $content_array[0]['title']?></h3>
			</div>
		</a>
		<?php
		break;
		case "newsbig":
		?>
		<a href="/news/view/<?php echo $content_array[0]['url_slug']?>" class="tile-item">
			<div class="item news large featured">
				<strong><?php echo format_date($content_array[0]['date'], "d")?><span class="accent">/</span><?php echo format_date($content_array[0]['date'], "m")?><span class="accent">/</span><?php echo format_date($content_array[0]['date'], "y")?></strong>
				<h2><?php echo $content_array[0]['title']?></h2>
				<div class="item-body"><?php echo $content_array[0]['summary']?></div>
			</div>
		</a>
		<?php
		break;
		case "social":
		?>
			<div class="item social single featured tile-item">
				<div class="slideshow homepage-tile-slideshow social">
					<div class="slide-holder" id="oSocialSlider<?php echo $i?>" data-interact="slideshow" data-interact-target="0" data-play="manual">
						<?php 
						$content_array_count = count($content_array);
						if($content_array_count > 0)
						{
							foreach($content_array as $tweets)
							{
						?>
						<div class="slide">
							<div class="slide-content">
								<div class="social-tweet">
									<div class="tweet-body"><?php echo linkify($tweets['tweet'])?></div>
									<div class="tweet-handle">
										<?php echo $tweets['tweet_signoff']?><br/>
										<a href="http://www.twitter.com/<?php echo $tweets['tweet_username']?>" target="_blank">@<?php echo $tweets['tweet_username']?></a>
									</div>
								</div>
							</div>
						</div>
						<?php 
							}
						}
						?>
					</div>
				</div>
				<div class="slide-handles right" data-special-class="small-bullet social" data-interact="slide-handles" data-linked="oSocialSlider<?php echo $i?>" data-handle="count"></div>
			</div>
		<?php
		break;
	}
}
?>